package com.youlu.campus.common.base.enums;

import com.youlu.campus.common.exception.ApiErrorCode;

/**
 * 管理端 CODE 枚举类
 */
public enum CodeEnum implements ApiErrorCode {
    SUCCESS(0, "OK"),
    FAILURE(0, "网络请求失败,请联系管理员"),
    FAIL(500, "网络请求错误,请稍后重试"),
    SERVER_BUSY(503, "当前业务繁忙,请稍后重试"),

    //用户相关错误 (兼容老版本)
    USER_LOGIN_EXPIRED(101, "登录已过期,请重新登录"),
    UNAUTHORIZED(401, "尊敬的用户,请您请先授权登录！"),
    NOT_FOUND(404, "请求路径不存在"),
    USER_NOT_LOGIN(110, "您未登录,请前往登录"),
    USER_IN_BLACK_LIST(1011, "当前用户信息异常,请联系管理员"),

    //请求相关错误  1100 开头
    REQUEST_HEADER_ERROR(1100, "网络请求错误,请检查请求头信息"),
    REQUEST_PARAM_ERROR(1101, "网络请求错误,请检查请参数"),

    LOGOUT_NAME_NOT_ALLOWD_MODIFIED(1007, "登录名不允许修改"),
    OLD_PASSWORD_NOT_MATCH(1008, "old password not matched"),
    LOGIN_NAME_CONFLICT(1009, "登录名已经存在"),
    UNAUTHORIZED2(401, "尊敬的用户,请您请先授权登录！"),

    USER_NOT_EXISTS(20001, "该账号不存在"),
    INCORRECT_USER(20002, "账号或密码错误"),
    USER_NOT_LOGIN_ADMIN(20003, "该账号未登录"),
    LOGIN_SUCCESS(20004, "该账号登录成功"),
    LOGOUT_SUCCESS(20005, "账号退出登录成功"),
    ERROR_PASSWORD(20006, "密码错误"),
    INVALID_AUTH_TOKEN(20010, "无效的登录凭据"),
    EXPIRED_AUTH_TOKEN(20011, "登录凭据已过期"),
    DOWNLINE_AUTH_TOKEN(20012, "登录已被强制下线"),
    F_LOGIN(20013, "用户被封禁,请联系管理员"),
    UNAUTHORIZED_ADMIN(20021, "资源未授权"),
    USER_NOT_ONLINE(20022, "用户不在线"),
    INVALID_ARGUMENT(20023, "账号或密码错误"),
    COMPANY_NOT_EXIST(20024, "公司不存在"),
    COMPANY_NOT_SUBSRIBE_PACKAGE(20025, "公司未签约套餐"),
    COMPANY_PACKAGE_EXPIRED(20026, "公司购买套餐已经过期,请联系管理员处理"),
    COMPANY_PACKAGE_NO_ENDTIME(20027, "公司购买套餐签约无效,无结束时间"),

    USER_PASSWORD_FORMAT_ERROR(20030, "字符必须包含字母、数字、符号中至少2种"),
    SUPPER_USER_NOT_DELETE(20031, "超级管理员不能被删除"),
    USER_NOT_DELETE_SELF(20032, "删除坐席不能删除自己"),
    LOGIN_EX(20033, "登陆异常,请联系管理员!"),
    CALLCENTER_SEAT_OVER_TOP(3103, "超过购买坐席数量"),
    CALLCENTER_NOT_OPEND(3104, "该企业未开通呼叫功能"),
    CALLCENTER_USER_BUSY(3105, "用户正忙"),
    PUBLIC_KEY_ERROR(3106, "用钥错误"),
    DECRYPT_ERROR(3107, "解密错误"),
    PARAMETER_ERROR(3108, "参数错误"),
    DATA_NOT_EXIST(3109, "数据不存在"),
    DATA_ALREADY_EXIST(3110, "数据已经存在"),
    INVALID_REQUEST(3111, "非法请求,请勿重试!"),
    PASSWORD_RETRY(3113, "密码重试过多,请联系管理员!"),

    //活动相关
    ACTIVITY_NOT_EXIST(40001, "活动不存在"),
    ACTIVITY_INVITE_FAIL(40002, "活动邀请失败"),
    ;


    CodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    private final int code;

    private final String message;


    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
